# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gcab
pkgver=1.5
pkgrel=1
pkgdesc="A GObject library to create cabinet files"
url="https://wiki.gnome.org/msitools"
arch=(x86_64)
license=(LGPL)
depends=(glib2)
makedepends=(gobject-introspection vala git gtk-doc meson)
provides=(libgcab-1.0.so)
_commit=d8054af4381dcef17ae691775c96a60116823047  # tags/v1.5^0
source=("git+https://gitlab.gnome.org/GNOME/gcab.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd gcab
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd gcab
}

build() {
  arch-meson gcab build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
